<html lang="en" ng-app="app">
<head>
    <meta charset="utf-8">
    <meta name="description" content="why520crazy">
    <meta name="author" content="why520crazy">

    <title>w5cValidator - Angular js </title>
    <link href="css/css.css" rel="stylesheet">
    <link href="lib/highlight/8.0/styles/default.css" rel="stylesheet">

</head>

<body>
<!--<div class="container">-->
<div class="wrap">
    <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">w5c-Validator</a>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="https://github.com/why520crazy/w5c-validator-angular">github 源代码</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container" data-ng-controller="validateCtrl" ng-cloak="">
        <form class="form-horizontal w5c-form demo-form" role="form"
              w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
            <div class="form-group">
                <label class="col-sm-2 control-label">邮箱</label>

                <div class="col-sm-10">
                    <input type="email" name="email" ng-model="entity.email" required="" class="form-control"
                           placeholder="输入邮箱">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">用户名</label>

                <div class="col-sm-10">
                    <input required="" ng-pattern="/^[A-Za-z]{1}[0-9A-Za-z_]{1,19}$/" ng-model="entity.name"
                           class="form-control" name="username" placeholder="输入用户名">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">密码</label>

                <div class="col-sm-10">
                    <input type="password" required="" ng-model="entity.password" name="password"
                           class="form-control" ng-minlength="5" ng-maxlength="15"
                           placeholder="输入密码">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">数字</label>

                <div class="col-sm-10">
                    <input type="number" required="" ng-model="entity.number" name="number" class="form-control"
                           placeholder="输入数字">
                </div>
            </div>
            <div class="form-group" ng-show="validateForm.$errors.length > 0 && vm.showErrorType == 2">
                <label class="col-sm-2 control-label"></label>

                <div class="col-sm-10">
                    <div class="alert alert-danger">{{validateForm.$errors[0]}}</div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="buttom" w5c-form-submit="vm.saveEntity()" class="btn btn-success"> 验证</button>
                </div>
            </div>
        </form>
        <div class="row">
            <div class="col-md-2"></div>
            <div class="col-md-10">
                <div class="checkbox">
                    <label>
                        <input ng-model="vm.validateOptions.blurTrig" type="checkbox"> 光标移走触发验证
                    </label>
                </div>
                <select class="form-control" ng-model="vm.showErrorType" ng-change="vm.changeShowType()">
                    <option value="1">每个输入框显示错误信息</option>
                    <option value="2">错误信息集中显示</option>
                </select>
            </div>
        </div>
    </div>
</div>

<div id="footer">
    <div class="container">

        <div class="pull-left">
            <p class="text-muted credit">
                <span>版权所有 © 2013 why520crazy</span></p></div>
        <div class="pull-right text-muted credit">
            <a target="_blank" href="http://weibo.com/why520crazy">新浪微博 @why520crazy</a> |
            <a target="_blank" href="http://why520crazy.cnblogs.com/">博客园博客</a> |
            <a target="_blank" href="https://worktile.com">Worktile</a>
        </div>

    </div>
</div>
<!--</div>-->

<script src="lib/jquery/1.11.0/jquery.js"></script>
<script src="lib/angular/1.2.0/angular.js"></script>
<script src="lib/bootstrap/3.0.0/js/bootstrap.js"></script>
<script src="lib/angular-ui/ui-bootstrap/0.9.0/ui-bootstrap-tpls.js"></script>
<script src="lib/highlight/8.0/highlight.pack.js"></script>
<script src="lib/angular-highlightjs/angular-highlightjs.js"></script>
<script src="w5cValidator.js"></script>
<script src="index.js"></script>
</body>
</html>